<?php

require('dbconnection.php');

$mongo = DBConnection::instantiate();
$collection = $mongo->getCollection('users');

$users = array(
                array(  
                        'name' => 'XXXX',
                        'username' => 'xxxx',
                        'password' => 'azerty',
                        'birthday'  => new MongoDate(strtotime('1971-09-29 00:00:00'))
                    ),
        );
        
foreach($users as $user)
{
    try{
        $collection->insert($user);
    } catch (MongoCursorException $e)
    {
        die($e->getMessage());
    }
}

echo 'Users created successfully';